package com.loren.oauth.utils;

import java.util.LinkedHashMap;
import java.util.Map;

public class MapUtils {

	public static Map<String, Object> parse(String mapString) {

		String resultString = mapString.substring(1, mapString.length() - 1);

		String[] objectArrays = resultString.split(", ");

		Map<String, Object> resultMap = new LinkedHashMap<>();

		for (String objectArray : objectArrays) {

			String[] resultArrays = objectArray.split("=");

			resultMap.put(resultArrays[0], resultArrays[1]);

		}

		return resultMap;
	}
}
